const knex = require('knex')({
    client: 'mysql',
    connection: {
        host: '127.0.0.1',
        user: 'root',
        port: "3306",
        password: '12liumingtai',
        database: 'yiwu_ems'
    }
});

async function init() {
    /*select*/
    var rows = await knex.select('*').where({
        user_name: '华为'
    }).table("ems_user")
    var one = await knex.first('*').where({
        user_name: '华为'
    }).table("ems_user")
    /*update */
    var updateResult = await knex('ems_user').where(one).update({user_name: "华为"})
    delete one.id;
    var insertResult = await knex('ems_user').insert(one)
    debugger
}

init()